The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Build.PL 14
Changes 09
MANIFEST 04
META.json 1114
META.yml 1114
README 11
lib/Dist/Zilla/Plugin/Git/Check.pm 22
lib/Dist/Zilla/Plugin/Git/Commit.pm 531
lib/Dist/Zilla/Plugin/Git/CommitBuild.pm 1132
lib/Dist/Zilla/Plugin/Git/Init.pm 22
lib/Dist/Zilla/Plugin/Git/NextVersion.pm 22
lib/Dist/Zilla/Plugin/Git/Push.pm 22
lib/Dist/Zilla/Plugin/Git/Tag.pm 22
lib/Dist/Zilla/Plugin/Git.pm 22
lib/Dist/Zilla/PluginBundle/Git.pm 22
lib/Dist/Zilla/Role/Git/DirtyFiles.pm 22
t/000-report-versions-tiny.t 03
t/2-commit-build-custom.t 17
t/2-commit-dirtydir.t 058
t/commit-build-custom/dist.ini 02
t/commit-dirtydir/Changes 06
t/commit-dirtydir/dist.ini 012
t/lib/Dist/Zilla/Plugin/MyTestArchiver.pm 029
23 files changed (This is a version diff) 57242
@@ -7,7 +7,9 @@ use Module::Build 0.3601;
 
 my %module_build_args = (
   'build_requires' => {
+    'Dist::Zilla::Role::Releaser' => '0',
     'Dist::Zilla::Tester' => '0',
+    'File::Copy' => '0',
     'File::Copy::Recursive' => '0',
     'File::Find' => '0',
     'File::pushd' => '0',
@@ -24,7 +26,7 @@ my %module_build_args = (
     'Jerome Quelin'
   ],
   'dist_name' => 'Dist-Zilla-Plugin-Git',
-  'dist_version' => '1.110330',
+  'dist_version' => '1.110500',
   'license' => 'perl',
   'module_name' => 'Dist::Zilla::Plugin::Git',
   'recommends' => {},
@@ -50,6 +52,7 @@ my %module_build_args = (
     'Moose::Role' => '0',
     'MooseX::Has::Sugar' => '0',
     'MooseX::Types::Moose' => '0',
+    'Path::Class::Dir' => '0',
     'String::Formatter' => '0',
     'Version::Next' => '0',
     'namespace::autoclean' => '0.09',
@@ -1,5 +1,14 @@
 Revision history for Dist::Zilla::Plugin::Git
 
+1.110500  2011-02-19 12:43:19 Europe/Paris
+ - add 'add_files_in' to Commit so you can commit an entire dir (Apocalypse)
+   If you need the same concept for Check please let us know!
+
+1.110480  2011-02-17 18:03:06 Europe/Paris
+ - CommitBuild support for release_message (nigel metheringham)
+ - Also supports %v & %t format tags, more appropriate for message on
+   commit build of the released package (nigel metheringham)
+
 1.110330  2011-02-02 10:36:33 Europe/Paris
  - fix rt#62484 - add a link to Git::NextVersion in main documentation
 
@@ -27,6 +27,7 @@ t/000-report-versions-tiny.t
 t/1-check.t
 t/2-commit-build-custom.t
 t/2-commit-build.t
+t/2-commit-dirtydir.t
 t/2-commit-ws.t
 t/2-commit.t
 t/3-tag.t
@@ -41,10 +42,13 @@ t/commit-build-custom/Changes
 t/commit-build-custom/dist.ini
 t/commit-build/Changes
 t/commit-build/dist.ini
+t/commit-dirtydir/Changes
+t/commit-dirtydir/dist.ini
 t/commit-ws/Changes
 t/commit-ws/dist.ini
 t/commit/Changes
 t/commit/dist.ini
+t/lib/Dist/Zilla/Plugin/MyTestArchiver.pm
 t/push-multi/Changes
 t/push-multi/dist.ini
 t/push/Changes
@@ -46,6 +46,7 @@
             "Moose::Role" : 0,
             "MooseX::Has::Sugar" : 0,
             "MooseX::Types::Moose" : 0,
+            "Path::Class::Dir" : 0,
             "String::Formatter" : 0,
             "Version::Next" : 0,
             "namespace::autoclean" : "0.09",
@@ -55,7 +56,9 @@
       },
       "test" : {
          "requires" : {
+            "Dist::Zilla::Role::Releaser" : 0,
             "Dist::Zilla::Tester" : 0,
+            "File::Copy" : 0,
             "File::Copy::Recursive" : 0,
             "File::Find" : 0,
             "File::pushd" : 0,
@@ -68,43 +71,43 @@
    "provides" : {
       "Dist::Zilla::Plugin::Git" : {
          "file" : "lib/Dist/Zilla/Plugin/Git.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::Check" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/Check.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::Commit" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/Commit.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::CommitBuild" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/CommitBuild.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::Init" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/Init.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::NextVersion" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/NextVersion.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::Push" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/Push.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Plugin::Git::Tag" : {
          "file" : "lib/Dist/Zilla/Plugin/Git/Tag.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::PluginBundle::Git" : {
          "file" : "lib/Dist/Zilla/PluginBundle/Git.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       },
       "Dist::Zilla::Role::Git::DirtyFiles" : {
          "file" : "lib/Dist/Zilla/Role/Git/DirtyFiles.pm",
-         "version" : "1.110330"
+         "version" : "1.110500"
       }
    },
    "release_status" : "stable",
@@ -121,7 +124,7 @@
       },
       "x_MailingList" : "http://www.listbox.com/subscribe/?list_id=139292"
    },
-   "version" : "1.110330",
+   "version" : "1.110500",
    "x_Dist_Zilla" : {
       "plugins" : [
          {
@@ -3,7 +3,9 @@ abstract: 'update your git repository after release'
 author:
   - 'Jerome Quelin'
 build_requires:
+  Dist::Zilla::Role::Releaser: 0
   Dist::Zilla::Tester: 0
+  File::Copy: 0
   File::Copy::Recursive: 0
   File::Find: 0
   File::pushd: 0
@@ -23,34 +25,34 @@ name: Dist-Zilla-Plugin-Git
 provides:
   Dist::Zilla::Plugin::Git:
     file: lib/Dist/Zilla/Plugin/Git.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::Check:
     file: lib/Dist/Zilla/Plugin/Git/Check.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::Commit:
     file: lib/Dist/Zilla/Plugin/Git/Commit.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::CommitBuild:
     file: lib/Dist/Zilla/Plugin/Git/CommitBuild.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::Init:
     file: lib/Dist/Zilla/Plugin/Git/Init.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::NextVersion:
     file: lib/Dist/Zilla/Plugin/Git/NextVersion.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::Push:
     file: lib/Dist/Zilla/Plugin/Git/Push.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Plugin::Git::Tag:
     file: lib/Dist/Zilla/Plugin/Git/Tag.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::PluginBundle::Git:
     file: lib/Dist/Zilla/PluginBundle/Git.pm
-    version: 1.110330
+    version: 1.110500
   Dist::Zilla::Role::Git::DirtyFiles:
     file: lib/Dist/Zilla/Role/Git/DirtyFiles.pm
-    version: 1.110330
+    version: 1.110500
 requires:
   Class::MOP: 0
   Cwd: 0
@@ -72,6 +74,7 @@ requires:
   Moose::Role: 0
   MooseX::Has::Sugar: 0
   MooseX::Types::Moose: 0
+  Path::Class::Dir: 0
   String::Formatter: 0
   Version::Next: 0
   namespace::autoclean: 0.09
@@ -82,7 +85,7 @@ resources:
   homepage: http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/
   repository: git://github.com/jquelin/dist-zilla-plugin-git.git
   x_MailingList: http://www.listbox.com/subscribe/?list_id=139292
-version: 1.110330
+version: 1.110500
 x_Dist_Zilla:
   plugins:
     -
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Dist-Zilla-Plugin-Git,
-version 1.110330:
+version 1.110500:
 
   update your git repository after release
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::Check;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::Check::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::Check::VERSION = '1.110500';
 }
 # ABSTRACT: check your git repository before releasing
 
@@ -78,7 +78,7 @@ Dist::Zilla::Plugin::Git::Check - check your git repository before releasing
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::Commit;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.110500';
 }
 # ABSTRACT: commit dirty files
 
@@ -21,6 +21,7 @@ use Git::Wrapper;
 use Moose;
 use MooseX::Has::Sugar;
 use MooseX::Types::Moose qw{ Str };
+use Path::Class::Dir ();
 
 use String::Formatter method_stringf => {
   -as => '_format_string',
@@ -45,10 +46,12 @@ with 'Dist::Zilla::Role::Git::DirtyFiles';
 
 has commit_msg => ( ro, isa=>Str, default => 'v%v%n%n%c' );
 has time_zone  => ( ro, isa=>Str, default => 'local' );
-
+has add_files_in  => ( ro, isa=>'ArrayRef[Str]', default => sub { [] } );
 
 # -- public methods
 
+sub mvp_multivalue_args { qw( add_files_in ) }
+
 sub after_release {
     my $self = shift;
     my $git  = Git::Wrapper->new('.');
@@ -59,7 +62,22 @@ sub after_release {
     # otherwise before_release would have failed, ending the release
     # process.
     @output = sort { lc $a cmp lc $b } $self->list_dirty_files($git, 1);
-    return unless @output;
+
+    # add any other untracked files to the commit list
+    if ( @{ $self->add_files_in } ) {
+        my @untracked_files = $git->ls_files( { others=>1, 'exclude-standard'=>1 } );
+        foreach my $f ( @untracked_files ) {
+            foreach my $path ( @{ $self->add_files_in } ) {
+                if ( Path::Class::Dir->new( $path )->subsumes( $f ) ) {
+                    push( @output, $f );
+                    last;
+                }
+            }
+        }
+    }
+
+    # if nothing to commit, we're done!
+    return unless @output;    
 
     # write commit message in a temp file
     my ($fh, $filename) = tempfile( 'DZP-git.XXXX', UNLINK => 1 );
@@ -111,7 +129,7 @@ Dist::Zilla::Plugin::Git::Commit - commit dirty files
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -137,6 +155,14 @@ The plugin accepts the following options:
 modified.  This option may appear multiple times.  The default
 list is F<dist.ini> and the changelog file given by C<changelog>.
 
+=item * add_files_in - a path that will have its new files checked in.
+This option may appear multiple times. This is used to add files
+generated during build-time to the repository, for example. The default
+list is empty.
+
+Note: The files have to be generated between those phases: BeforeRelease
+E<lt>-E<gt> AfterRelease, and after Git::Check + before Git::Commit.
+
 =item * commit_msg - the commit message to use. Defaults to
 C<v%v%n%n%c>, meaning the version number and the list of changes.
 
@@ -184,7 +210,7 @@ the distribution version
 This method returns the commit message.  The default implementation
 reads the Changes file to get the list of changes in the just-released version.
 
-=for Pod::Coverage after_release
+=for Pod::Coverage after_release mvp_multivalue_args
 
 =head1 AUTHOR
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::CommitBuild;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.110500';
 }
 # ABSTRACT: checkin build results on separate branch
 
@@ -35,9 +35,11 @@ use String::Formatter (
 	method_stringf => {
 		-as   => '_format_message',
 		codes => {
-			b => sub { (shift->name_rev( '--name-only', 'HEAD' ))[0] },
-			h => sub { (shift->rev_parse( '--short',    'HEAD' ))[0] },
-			H => sub { (shift->rev_parse('HEAD'))[0] },
+			b => sub { (shift->_git->name_rev( '--name-only', 'HEAD' ))[0] },
+			h => sub { (shift->_git->rev_parse( '--short',    'HEAD' ))[0] },
+			H => sub { (shift->_git->rev_parse('HEAD'))[0] },
+		    t => sub { shift->zilla->is_trial ? '-TRIAL' : '' },
+		    v => sub { shift->zilla->version },
 		}
 	}
 );
@@ -49,7 +51,13 @@ with 'Dist::Zilla::Role::AfterBuild', 'Dist::Zilla::Role::AfterRelease';
 has branch  => ( ro, isa => Str, default => 'build/%b', required => 1 );
 has release_branch  => ( ro, isa => Str, required => 0 );
 has message => ( ro, isa => Str, default => 'Build results of %h (on %b)', required => 1 );
+has release_message => ( ro, isa => Str, lazy => 1, builder => '_build_release_message' );
 has build_root => ( rw );
+has _git => (rw, weak_ref => 1);
+
+# -- attribute builders
+
+sub _build_release_message { return shift->message; }
 
 # -- role implementation
 
@@ -60,22 +68,23 @@ sub after_build {
     # the 'after_release' stage
     $self->build_root( $args->{build_root} );
 
-    $self->_commit_build( $args, $self->branch );
+    $self->_commit_build( $args, $self->branch, $self->message );
 }
 
 sub after_release {
     my ( $self, $args) = @_;
 
-    $self->_commit_build( $args, $self->release_branch );
+    $self->_commit_build( $args, $self->release_branch, $self->release_message );
 }
 
 sub _commit_build {
-    my ( $self, undef, $branch ) = @_;
+    my ( $self, undef, $branch, $message ) = @_;
 
     return unless $branch;
 
     my $tmp_dir = File::Temp->newdir( CLEANUP => 1) ;
     my $src     = Git::Wrapper->new('.');
+    $self->_git($src);
 
     my $dir = rel2abs( $self->build_root );
 
@@ -114,7 +123,7 @@ sub _commit_build {
         #
         my ($fh, $filename) = File::Temp::tempfile();
         $fh->autoflush(1);
-        print $fh _format_message( $self->message, $src );
+        print $fh _format_message( $message, $self );
 
         my @args=('git', 'commit-tree', $tree, map { ( -p => $_ ) } @parents);
         push @args,'<'.$filename;
@@ -139,7 +148,7 @@ Dist::Zilla::Plugin::Git::CommitBuild - checkin build results on separate branch
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -163,11 +172,14 @@ The plugin accepts the following options:
 =over 4
 
 =item * branch - L<String::Formatter> string for where to commit the
-build contents
+build contents.
 
 A single formatting code (C<%b>) is defined for this attribute and will be
 substituted with the name of the current branch in your git repository.
 
+Defaults to C<build/%b>, but if set explicitly to an empty string
+causes no build contents checkin to be made.
+
 =item * release_branch - L<String::Formatter> string for where to commit the
 build contents
 
@@ -177,7 +189,7 @@ default, meaning no release branch.
 =item * message - L<String::Formatter> string for what commit message
 to use when committing the results of the build.
 
-This option supports three formatting codes:
+This option supports five formatting codes:
 
 =over 4
 
@@ -187,8 +199,16 @@ This option supports three formatting codes:
 
 =item * C<%h> - Abbreviated commit hash
 
+=item * C<%v> - The release version number
+
+=item * C<%t> - The string "-TRIAL" if this is a trial release
+
 =back
 
+=item * release_message - L<String::Formatter> string for what
+commit message to use when committing the results of the release.
+Defaults to the same as C<message>.
+
 =back
 
 =for Pod::Coverage after_build
@@ -210,3 +230,4 @@ the same terms as the Perl 5 programming language system itself.
 
 __END__
 
+
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::Init;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::Init::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::Init::VERSION = '1.110500';
 }
 # ABSTRACT: initialize git repository on dzil new
 
@@ -88,7 +88,7 @@ Dist::Zilla::Plugin::Git::Init - initialize git repository on dzil new
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -11,7 +11,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::NextVersion;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::NextVersion::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::NextVersion::VERSION = '1.110500';
 }
 # ABSTRACT: provide a version number by bumping the last git release tag
 
@@ -75,7 +75,7 @@ Dist::Zilla::Plugin::Git::NextVersion - provide a version number by bumping the
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::Push;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::Push::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::Push::VERSION = '1.110500';
 }
 # ABSTRACT: push current branch
 
@@ -59,7 +59,7 @@ Dist::Zilla::Plugin::Git::Push - push current branch
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git::Tag;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.110500';
 }
 # ABSTRACT: tag the new version
 
@@ -94,7 +94,7 @@ Dist::Zilla::Plugin::Git::Tag - tag the new version
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Plugin::Git;
 BEGIN {
-  $Dist::Zilla::Plugin::Git::VERSION = '1.110330';
+  $Dist::Zilla::Plugin::Git::VERSION = '1.110500';
 }
 # ABSTRACT: update your git repository after release
 
@@ -28,7 +28,7 @@ Dist::Zilla::Plugin::Git - update your git repository after release
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 DESCRIPTION
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::PluginBundle::Git;
 BEGIN {
-  $Dist::Zilla::PluginBundle::Git::VERSION = '1.110330';
+  $Dist::Zilla::PluginBundle::Git::VERSION = '1.110500';
 }
 # ABSTRACT: all git plugins in one go
 
@@ -66,7 +66,7 @@ Dist::Zilla::PluginBundle::Git - all git plugins in one go
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 SYNOPSIS
 
@@ -12,7 +12,7 @@ use warnings;
 
 package Dist::Zilla::Role::Git::DirtyFiles;
 BEGIN {
-  $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.110330';
+  $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.110500';
 }
 # ABSTRACT: provide the allow_dirty & changelog attributes
 
@@ -70,7 +70,7 @@ Dist::Zilla::Role::Git::DirtyFiles - provide the allow_dirty & changelog attribu
 
 =head1 VERSION
 
-version 1.110330
+version 1.110500
 
 =head1 DESCRIPTION
 
@@ -57,8 +57,10 @@ eval { $v .= pmver('Dist::Zilla::Role::AfterMint','any version') };
 eval { $v .= pmver('Dist::Zilla::Role::AfterRelease','any version') };
 eval { $v .= pmver('Dist::Zilla::Role::BeforeRelease','any version') };
 eval { $v .= pmver('Dist::Zilla::Role::PluginBundle','any version') };
+eval { $v .= pmver('Dist::Zilla::Role::Releaser','any version') };
 eval { $v .= pmver('Dist::Zilla::Role::VersionProvider','any version') };
 eval { $v .= pmver('Dist::Zilla::Tester','any version') };
+eval { $v .= pmver('File::Copy','any version') };
 eval { $v .= pmver('File::Copy::Recursive','any version') };
 eval { $v .= pmver('File::Find','any version') };
 eval { $v .= pmver('File::Spec::Functions','any version') };
@@ -74,6 +76,7 @@ eval { $v .= pmver('Moose::Role','any version') };
 eval { $v .= pmver('MooseX::Has::Sugar','any version') };
 eval { $v .= pmver('MooseX::Types::Moose','any version') };
 eval { $v .= pmver('Path::Class','any version') };
+eval { $v .= pmver('Path::Class::Dir','any version') };
 eval { $v .= pmver('String::Formatter','any version') };
 eval { $v .= pmver('Test::Exception','any version') };
 eval { $v .= pmver('Test::More','0.88') };
@@ -15,7 +15,7 @@ use Dist::Zilla  1.093250;
 use Dist::Zilla::Tester;
 use Git::Wrapper;
 use Path::Class;
-use Test::More   tests => 2;
+use Test::More   tests => 5;
 use Cwd qw(cwd);
 
 my $cwd = cwd();
@@ -37,3 +37,9 @@ $git->branch(-m => 'dev');
 $zilla->build;
 ok( eval { $git->rev_parse('-q', '--verify', 'refs/heads/build-dev') }, 'source repo has the "build-dev" branch') or diag explain $@, $git->branch;
 is( $git->log('build-dev'), 2, 'one commit on the build-dev branch') or diag $git->branch;
+
+$zilla->release;
+ok( eval { $git->rev_parse('-q', '--verify', 'refs/heads/release') }, 'source repo has the "release" branch') or diag explain $@, $git->branch;
+my @logs = $git->log('release');
+is( scalar(@logs), 2, 'one commit on the release branch') or diag $git->branch;
+like( $logs[0]->message, qr/^Release of 1\.23\b/, 'correct release commit log message generated');
@@ -0,0 +1,58 @@
+#!perl
+#
+# This file is part of Dist-Zilla-Plugin-Git
+#
+# This software is copyright (c) 2009 by Jerome Quelin.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+
+use strict;
+use warnings;
+
+use Dist::Zilla  1.093250;
+use Dist::Zilla::Tester;
+use Git::Wrapper;
+use Path::Class;
+use lib 't/lib';
+use Test::More   tests => 3;
+
+# build fake repository
+my $zilla = Dist::Zilla::Tester->from_config({
+  dist_root => dir(qw(t commit-dirtydir)),
+});
+
+chdir $zilla->tempdir->subdir('source');
+system "git init";
+my $git = Git::Wrapper->new('.');
+$git->config( 'user.name'  => 'dzp-git test' );
+$git->config( 'user.email' => 'dzp-git@test' );
+$git->add( qw{ dist.ini Changes } );
+$git->commit( { message => 'initial commit' } );
+
+# do a release, with changes and dist.ini updated
+append_to_file('Changes',  "\n");
+append_to_file('dist.ini', "\n");
+$zilla->release;
+
+# check if dist.ini and changelog have been committed
+my ($log) = $git->log( 'HEAD' );
+is( $log->message, "v1.23\n\n- foo\n- bar\n- baz\n", 'commit message taken from changelog' );
+
+# check if we committed our tarball
+my @files = $git->ls_files( { cached => 1 } );
+ok( ( grep { $_ =~ /releases/ } @files ), "We committed the tarball" );
+
+# We should have no dirty files uncommitted
+# ignore the "DZP-git.9y5u" temp file, ha!
+@files = $git->ls_files( { others => 1, modified => 1, unmerged => 1 } );
+ok( @files == 1, "No untracked files left" );
+
+sub append_to_file {
+    my ($file, @lines) = @_;
+    open my $fh, '>>', $file or die "can't open $file: $!";
+    print $fh @lines;
+    close $fh;
+}
+
@@ -11,3 +11,5 @@ copyright_year   = 2009
 [FakeRelease]
 [Git::CommitBuild]
 branch = build-%b
+release_branch = release
+release_message = Release of %v
@@ -0,0 +1,6 @@
+Changes
+
+1.23 2009-11-16 19:15:45 CET
+ - foo
+ - bar
+ - baz
@@ -0,0 +1,12 @@
+name    = Foo
+version = 1.23
+author  = foobar
+license = Perl_5
+abstract = Test Library
+copyright_holder = foobar
+copyright_year   = 2009
+
+[FakeRelease]
+[MyTestArchiver]
+[Git::Commit]
+add_files_in = releases
@@ -0,0 +1,29 @@
+#
+# This file is part of Dist-Zilla-Plugin-Git
+#
+# This software is copyright (c) 2009 by Jerome Quelin.
+#
+# This is free software; you can redistribute it and/or modify it under
+# the same terms as the Perl 5 programming language system itself.
+#
+# taken from DZP::ArchiveRelease, thanks CJM!
+package Dist::Zilla::Plugin::MyTestArchiver;
+use Moose;
+use Moose::Autobox;
+use Path::Class::Dir ();
+use File::Copy ();
+
+with 'Dist::Zilla::Role::Releaser';
+
+sub release {
+    my ($self, $tgz) = @_;
+
+    chmod(0444, $tgz);
+    my $dir = 'releases';
+    mkdir $dir or $self->log_fatal( "Unable to create directory $dir: $!" );
+    my $dest = Path::Class::Dir->new( $dir )->file($tgz->basename);
+    File::Copy::move($tgz, $dest) or $self->log_fatal( "Unable to move: $!" );
+    $self->log("Moved $tgz to $dest");
+}
+
+1;